package iterator;

/**
 * ${DESCRIPTION}
 *
 * @author luckyhua
 * @version 1.0
 * @since 2017/6/22
 */
public class Test {

    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf(4);
        bookShelf.appendBook(new Book("java"));
        bookShelf.appendBook(new Book("c++"));
        bookShelf.appendBook(new Book("python"));
        bookShelf.appendBook(new Book("ruby"));
        Iterator iterator = bookShelf.iterator();
        while (iterator.hasNext()) {
            Book book = (Book) iterator.next();
            System.out.println(book.getName());
        }
    }

}
